package Operaciones;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

import BasedeDatos.*;


public class EliminacionBD {
	Connection con;
	
	public void eliminarReporteItem(int entry) throws SQLException{
		con = Conexion.conexion();
		Statement stmt = con.createStatement();
		Statement stmt1 = con.createStatement();
		String q = "DELETE FROM itemasignado WHERE item = '"+entry+"';";
		String q1 = "DELETE FROM item WHERE entry = '"+entry+"';";
		stmt.executeUpdate(q);
		stmt1.executeUpdate(q1);
	}
	
	public void eliminarReporteNpc(int entry) throws SQLException{
		con = Conexion.conexion();
		Statement stmt = con.createStatement();
		Statement stmt1 = con.createStatement();
		String q = "DELETE FROM npcasignado WHERE npc = '"+entry+"';";
		String q1 = "DELETE FROM npc WHERE entry = '"+entry+"';";
		stmt.executeUpdate(q);
		stmt1.executeUpdate(q1);
	}
	
	public void eliminarReporteSpell(int entry) throws SQLException{
		con = Conexion.conexion();
		Statement stmt = con.createStatement();
		Statement stmt1 = con.createStatement();
		String q = "DELETE FROM spellasignado WHERE spell = '"+entry+"';";
		String q1 = "DELETE FROM spell WHERE entry = '"+entry+"';";
		stmt.executeUpdate(q);
		stmt1.executeUpdate(q1);
	}
	
	public void eliminarReporteMision(int entryA, int entryH, int ambas) throws SQLException{
		con = Conexion.conexion();
		Statement stmt = con.createStatement();
		Statement stmt1 = con.createStatement();
		String q = "DELETE FROM misionasignado WHERE entryA = '"+entryA+"' AND entryH = '"+entryH+"' AND ambas = '"+ambas+"';";
		String q1 = "DELETE FROM mision WHERE entryA = '"+entryA+"' AND entryH = '"+entryH+"' AND ambas = '"+ambas+"';";
		stmt.executeUpdate(q);
		stmt1.executeUpdate(q1);
	}

}
